import Vue from 'vue'
import App from './App.vue'
import { registerMicroApps, start, addErrorHandler } from 'qiankun';
import router from './router'

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#main-app')

registerMicroApps([
  {
    name: 'child-app-one', // app name registered
    entry: '//localhost:2000',
    container: '#micro-view',
    activeRule: '/#/one',
  },
  {
    name: 'child-app-two', // app name registered
    entry: '//localhost:3000',
    container: '#micro-view',
    activeRule: '/#/two',
  },
])

addErrorHandler(event => console.log(event));

start();
